home *** CD-ROM | disk | FTP | other *** search
- #pragma once // prevents multiple inclusions
-
- /* This class implements a simple ballistic particle in 2D with position, velocity,
- and acceleration (all of which are "Fixed point Points"). The velocity and
- acceleration are treated as 2D vectors, and their units are pixels per frame and
- pixels per frame per frame, respectively. This conveniently eliminates mass
- considerations in the math. The reason I do this is 'cuz it's faster. There are only
- three routines: InitParticle, which sets the values of the variables; NextStep, which
- moves the particle a time step of 1, calculating the new position and velocity; and
- Step, which takes an integer and moves that many steps. Note that there are no
- drawing routines, and that all three variables are available only to subclasses. */
-
- #include "FlockTypes.h"
-
- class CParticle
- {
- protected:
- FloatPoint fPosition;
- FloatPoint fVelocity;
- FloatPoint fAcceleration;
-
- CParticle *InitParticle(FloatPoint *ipos, FloatPoint *ivel, FloatPoint *iaccel);
-
- // Stepping functions
- void NextStep(void);
- void Step(short steps);
- }; // size = 24 bytes
-